package com.bigShen.pattern.observer.event;

import java.lang.reflect.Method;

/**
 * @author : lei.shen
 * @date : 2018/10/7
 */
public class Event {

    // 事件源
    private Object publisher;

    // 通知目标
    private Object listener;

    private Method callback;

    private Long time;

    private String triggerType;

    public Event(Object listener, Method callback, String triggerType) {
        this.listener = listener;
        this.callback = callback;
        this.triggerType = triggerType;
    }

    public Object getPublisher() {
        return publisher;
    }

    public void setPublisher(Object publisher) {
        this.publisher = publisher;
    }

    public Object getListener() {
        return listener;
    }

    public void setListener(Object listener) {
        this.listener = listener;
    }

    public Method getCallback() {
        return callback;
    }

    public void setCallback(Method callback) {
        this.callback = callback;
    }

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public String getTriggerType() {
        return triggerType;
    }

    public void setTriggerType(String triggerType) {
        this.triggerType = triggerType;
    }

    @Override
    public String toString() {
        return "Event{" +
                "\n publisher=" + publisher +
                ",\n listener=" + listener +
                ",\n callback=" + callback +
                ",\n time=" + time +
                ",\n triggerType='" + triggerType + '\'' +
                '}';
    }
}
